package cn.edu.nwsuaf.examcenter.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * ExamPaperInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "exam_paper_info", catalog = "exam")
public class ExamPaperInfo implements java.io.Serializable {

	// Fields

	private String examPaperNo;
	private Teacher teacher;
	private Cource cource;
	private String examPaperTitle;
	private Float examPaperScore;
	private Integer examPaperIscheck;
	private String examPaperDuration;
	private String examPaperDate;
	private Set<StudentExamScore> studentExamScores = new HashSet<StudentExamScore>(
			0);
	private Set<StudentExamInfo> studentExamInfos = new HashSet<StudentExamInfo>(
			0);
	private Set<ExamContent> examContents = new HashSet<ExamContent>(0);

	// Constructors

	/** default constructor */
	public ExamPaperInfo() {
	}

	/** minimal constructor */
	public ExamPaperInfo(String examPaperNo, Teacher teacher, Cource cource,
			String examPaperTitle, Float examPaperScore,
			Integer examPaperIscheck, String examPaperDuration,
			String examPaperDate) {
		this.examPaperNo = examPaperNo;
		this.teacher = teacher;
		this.cource = cource;
		this.examPaperTitle = examPaperTitle;
		this.examPaperScore = examPaperScore;
		this.examPaperIscheck = examPaperIscheck;
		this.examPaperDuration = examPaperDuration;
		this.examPaperDate = examPaperDate;
	}

	/** full constructor */
	public ExamPaperInfo(String examPaperNo, Teacher teacher, Cource cource,
			String examPaperTitle, Float examPaperScore,
			Integer examPaperIscheck, String examPaperDuration,
			String examPaperDate, Set<StudentExamScore> studentExamScores,
			Set<StudentExamInfo> studentExamInfos, Set<ExamContent> examContents) {
		this.examPaperNo = examPaperNo;
		this.teacher = teacher;
		this.cource = cource;
		this.examPaperTitle = examPaperTitle;
		this.examPaperScore = examPaperScore;
		this.examPaperIscheck = examPaperIscheck;
		this.examPaperDuration = examPaperDuration;
		this.examPaperDate = examPaperDate;
		this.studentExamScores = studentExamScores;
		this.studentExamInfos = studentExamInfos;
		this.examContents = examContents;
	}

	// Property accessors
	@Id
	@Column(name = "exam_paper_no", unique = true, nullable = false, length = 50)
	public String getExamPaperNo() {
		return this.examPaperNo;
	}

	public void setExamPaperNo(String examPaperNo) {
		this.examPaperNo = examPaperNo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "teacher_no", nullable = false)
	public Teacher getTeacher() {
		return this.teacher;
	}

	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "cource_no", nullable = false)
	public Cource getCource() {
		return this.cource;
	}

	public void setCource(Cource cource) {
		this.cource = cource;
	}

	@Column(name = "exam_paper_title", nullable = false, length = 50)
	public String getExamPaperTitle() {
		return this.examPaperTitle;
	}

	public void setExamPaperTitle(String examPaperTitle) {
		this.examPaperTitle = examPaperTitle;
	}

	@Column(name = "exam_paper_score", nullable = false, precision = 12, scale = 0)
	public Float getExamPaperScore() {
		return this.examPaperScore;
	}

	public void setExamPaperScore(Float examPaperScore) {
		this.examPaperScore = examPaperScore;
	}

	@Column(name = "exam_paper_ischeck", nullable = false)
	public Integer getExamPaperIscheck() {
		return this.examPaperIscheck;
	}

	public void setExamPaperIscheck(Integer examPaperIscheck) {
		this.examPaperIscheck = examPaperIscheck;
	}

	@Column(name = "exam_paper_duration", nullable = false, length = 50)
	public String getExamPaperDuration() {
		return this.examPaperDuration;
	}

	public void setExamPaperDuration(String examPaperDuration) {
		this.examPaperDuration = examPaperDuration;
	}

	@Column(name = "exam_paper_date", nullable = false, length = 50)
	public String getExamPaperDate() {
		return this.examPaperDate;
	}

	public void setExamPaperDate(String examPaperDate) {
		this.examPaperDate = examPaperDate;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "examPaperInfo")
	public Set<StudentExamScore> getStudentExamScores() {
		return this.studentExamScores;
	}

	public void setStudentExamScores(Set<StudentExamScore> studentExamScores) {
		this.studentExamScores = studentExamScores;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "examPaperInfo")
	public Set<StudentExamInfo> getStudentExamInfos() {
		return this.studentExamInfos;
	}

	public void setStudentExamInfos(Set<StudentExamInfo> studentExamInfos) {
		this.studentExamInfos = studentExamInfos;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "examPaperInfo")
	public Set<ExamContent> getExamContents() {
		return this.examContents;
	}

	public void setExamContents(Set<ExamContent> examContents) {
		this.examContents = examContents;
	}

}